/************************************************************
 * Project Name         [Thinking_In_Java]
 * File Name            [Example_03_Vector.java]
 * Creation Date        [01-Jul-2014]
 * 
 * Copyright© ge.y.yang@gmail.com All Rights Reserved
 * 
 * Work hard, play harder, think big and keep fit
 ************************************************************/
package pkg_06_collections;

import java.util.Enumeration;
import java.util.Vector;

/**
 * 集合框架 java.util.Vector
 * 
 * @author 不落的太阳(Sean Yang)
 * @version 1.0
 * @since JDK 6
 * 
 */
public class Example_03_Vector {

	/**
	 * 测试方法
	 * 
	 * @param args
	 *            命令行参数
	 */
	public static void main(String[] args) {
		Vector<String> vector = new Vector<String>();
		vector.add("aaa");
		vector.add("bbb");
		vector.add("ccc");

		String str2 = vector.elementAt(2);
		System.out.println(str2);

		// 遍历Vector
		Enumeration<String> iter = vector.elements();
		while (iter.hasMoreElements()) {
			String str = iter.nextElement();
			System.out.println(str);
		}
		// Vector其他方法参考java.util.List API
	}
}
